#ifndef MODEL_COMMENT_HPP
#define MODEL_COMMENT_HPP

#include "Model/ModelConfig.hpp"
#include <boost/date_time/posix_time/posix_time_types.hpp>

namespace Model
{

/// @ingroup Model
/// @brief It describes a comment added by a user.
class MODEL_API Comment
{
public:
	/// @brief It initializes the comment.
	/// @param authorName the name of the user that made the comment.
	/// @param creationTime the moment of specifying the comment. By default is the current time.
	Comment( const String& authorName, 
		const boost::posix_time::ptime& creationTime = boost::date_time::second_clock< boost::posix_time::ptime>::local_time());

	/// @brief It copies the comment. The creation time and last changed time are set to the current time.
	Comment( const Comment& orig);

	/// @brief It copies the comment. The creation time is copied from the original. Last changed time is set to current 
	///		time.
	Comment& operator=( const Comment& orig);

	/// @brief It gets the author of the comment.
	const String& authorName() const { return authorName_; }

	/// @brief It gets the time when the comment was created.
	const boost::posix_time::ptime& creationTime() const { return creationTime_; }

	/// @brief It gets the latest time when the comment was changed.
	const boost::posix_time::ptime& lastChangeTime() const { return lastChangeTime_; }

	/// @brief It gets the body of the comment.
	const RichText& body() const { return body_; }

private:
	String authorName_;
	boost::posix_time::ptime creationTime_;
	boost::posix_time::ptime lastChangeTime_;
	RichText body_;
};

} // namespace Model

#endif // MODEL_COMMENT_HPP
